package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.amap.api.services.core.PoiItem;
import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import stark.common.apis.base.JtwzdmQueryBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;
import stark.common.basic.utils.DistanceUtil;

public class HistoryAdapter extends StkProviderMultiAdapter<JtwzdmQueryBean> {

    public HistoryAdapter() {
        addItemProvider(new StkSingleSpanProvider<>(40));
        addItemProvider(new HistoryProvider());
    }

    private class HistoryProvider extends BaseItemProvider<JtwzdmQueryBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_history;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, JtwzdmQueryBean bean) {
            baseViewHolder.setText(R.id.tvHistoryItemCode,context.getString(R.string.peccancy_code)+bean.code);
            baseViewHolder.setText(R.id.tvHistoryItemBehavior, context.getString(R.string.peccancy_behavior)+bean.illegal);
            baseViewHolder.setText(R.id.tvHistoryItemResult, context.getString(R.string.punishment_result)+bean.others);
            baseViewHolder.setText(R.id.tvHistoryItemAmount, context.getString(R.string.fine_amount)+bean.fine);
            baseViewHolder.setText(R.id.tvHistoryItemScore, context.getString(R.string.score,bean.points));

        }
    }

}
